package com;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.pojo.Username;
import lombok.SneakyThrows;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: fanyouzhao
 * @date: 13:06 2021/6/29
 */
public class ExcelListener extends AnalysisEventListener<Username> {

    List<Username> list = new ArrayList<>();

    @SneakyThrows
    @Override
    public void invoke(Username username, AnalysisContext analysisContext) {
        String code = Login.login(username.getUsername());
        if ("200".equals(code)){
            System.out.println(username.getUsername()+"登录成功");
        }
        // list.add(username);
        // list.forEach(System.out::println);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
